<?php

namespace addons\HuaFeng\common\models;

use Yii;
use common\models\base\BaseModel;

/**
 * This is the model class for table "{{%hua_procure}}".
 *
 * @property int $id 主键id
 * @property string $number 编号
 * @property int $supplier_id 供应商主键id
 * @property string $linkman 联系人
 * @property string $linkmobile 联系方式
 * @property string $delivery_date 交货日期
 * @property int $store_id 入仓仓库主键id
 * @property int $type 1.买家自提 2.卖方发货 3.代发
 * @property string $billing_date 制单日期
 * @property int $status -1:已删除,0:禁用,1:正常
 * @property int $created_at 创建时间
 * @property int $updated_at 修改时间
 */
class Procure extends BaseModel
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%hua_procure}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['supplier_id', 'store_id', 'type', 'status', 'created_at', 'updated_at'], 'integer'],
            [['delivery_date'], 'required'],
            [['delivery_date', 'billing_date'], 'safe'],
            [['number'], 'string', 'max' => 20],
            [['linkman'], 'string', 'max' => 50],
            [['linkmobile'], 'string', 'max' => 11],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => '主键id',
            'number' => '编号',
            'supplier_id' => '供应商主键id',
            'linkman' => '联系人',
            'linkmobile' => '联系方式',
            'delivery_date' => '交货日期',
            'store_id' => '入仓仓库主键id',
            'type' => '类型',
            'billing_date' => '制单日期',
            'status' => '-1:已删除,0:禁用,1:正常',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }
}
